<jsp:useBean id="db" scope="session" class="com.jipl.Masters.DatabaseBean"/>
<jsp:setProperty name="db" property="*"/>  
<html xmlns="http://www.w3.org/1999/xhtml">
    <!-- DW6 -->
    <head>
        <!-- Copyright 2005 Macromedia, Inc. All rights reserved. -->
        <title>Edit ItemGroup</title>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
        <link rel="stylesheet" href="images/mm_health_nutr.css" type="text/css" />
        <script language="JavaScript" type="text/javascript">
            //--------------- LOCALIZEABLE GLOBALS ---------------
            var d=new Date();
            var monthname=new Array("January","February","March","April","May","June","July","August","September","October","November","December");
            //Ensure correct for language. English is "January 1, 2004"
            var TODAY = monthname[d.getMonth()] + " " + d.getDate() + ", " + d.getFullYear();
            //---------------   END LOCALIZEABLE   ---------------
        </script>
        <script language="JavaScript" type="text/javascript" src="Scripts/ItemMasterValidations.js">


        </script>
        <style type="text/css">
            <!--
            .style1 {
                color: #F4FFE4;
                font-weight: bold;
                font-size: 12px;
            }
            -->
        </style>
        <link href="../../images/mm_health_nutr.css" rel="stylesheet" type="text/css">
        <style type="text/css">
            <!--
            a {
                font-size: 12px;
                font-weight: bold;
            }
            a:link {
                text-decoration: none;
            }
            a:visited {
                text-decoration: none;
            }
            a:hover {
                text-decoration: none;
            }
            a:active {
                text-decoration: none;
            }
            .style2 {
                font-size: 13px;
                font-weight: bold;
            }
            -->
        </style></head>
    <body bgcolor="#5C743D">
        <br>
        <br>
        <br>

        <table width="100%" height="695" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
                <td height="558" align="center" valign="top" colspan="2"  background="../../images/flash_body1.png">
                    <form id="form1" name="form1" method="post" action="eSingle.jsp" onSubmit="return ValidateItemGroupEdit();">
                        <table width="456" border="0" align="center" cellpadding="0" cellspacing="0" style="border-right: #FFFFFF 1px solid;
                               border-top: #FFFFFF 1px solid; border-left: #FFFFFF 1px solid;  border-bottom: #FFFFFF 1px solid; font-size: 9pt; color: #000000; font-family: Arial;">
                            <tr>
                                <td height="31" colspan="3" align="center" valign="middle" background="../../images/flash_header1.png" bgcolor="#3E7550"><span class="style2">Select Group </span></td>
                            </tr>
                            <tr>
                                <td width="146" align="center" valign="middle"><span class="style1">Item Group</span></td>
                                <td width="144" align="center" valign="middle"><select name="tgroup" id="tgroup">
                                        <option> </option>
                                        <%@ page import="java.io.* , java.util.*, java.sql.*"%>
                                        <%
                                                request.getSession(true);
                                                String typ=request.getParameter("tedit");
		
                                                String get_item_id="select ino from itypes where itype='"+typ+"'";
                                                        System.out.println(get_item_id+"-----------");
                                                        ResultSet get_it_id=db.execSQL(get_item_id);
                                                        int gid=0;
                                                        if (get_it_id.next()==true)
                                                                        gid=get_it_id.getInt(1);
					
                                                request.getSession(true);
                                                session.setAttribute("type",typ);
                                                                  String q="select distinct(item_group_name) from igroup where item_type_id="+gid;
                                                                  System.out.print(q);
                                                                  db.connect();
                                                                  ResultSet rs=db.execSQL(q);
                                                                  while (rs.next()==true)
                                                                  {
                                        %>
                                        <option><%=rs.getString(1)%></option>
                                        <%}%>
                                    </select></td>
                                <td width="144" align="center" valign="middle"><input name="Submit2" type="submit" class="subHeader"  value="Edit" /></td>
                            </tr>
                        </table>
                    </form></td>
            </tr>

            <tr>
                <td background="../../images/flash_body1.png">&nbsp;</td>
            </tr>
        </table>
    </body>
</html>
